Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods


ODMenuBar

Superclasses
ODRefCntObject --> ODObject
Subclasses
none

An object of the ODMenuBar class represents a composite menu bar object, made up of menus from the document shell and the active part.

Description

When OpenDoc first opens a document, the document shell creates a menu bar object, adds menus to it, and installs it as the base menu bar object, which contains the default set of menus shared by all parts in the document. Part editors can obtain a copy of the base menu bar object by calling the window-state object's CopyBaseMenuBar method (page 855), add menus to it, and install it as the current menu bar object .

Your part creates a empty menu bar by calling the window-state object's CreateMenuBar method (page 858). Your part can also create a copy of an existing menu bar object by calling its menu bar object's Copy method (page 399). These methods return a reference to a menu bar object.

OpenDoc allows the document shell and part editors to register command IDs for menu items. If no command ID is registered, a synthetic command ID, one that is manufactured from the menu and menu item IDs, is generated. If a command ID is not registered and not synthetic, a part should not handle it.

Methods

This section presents summary descriptions of the ODMenuBar methods grouped according to purpose, followed by detailed descriptions in alphabetical order. Methods marked [M] are specific to the Mac OS platform.

Menu Bars

Copy
Copies this menu bar object.
Display
Installs this menu bar object as the current menu bar, making it visible and active.
IsValid
Returns a Boolean value that indicates whether this menu bar object is equivalent to the base menu bar object from which it was copied.
Menus

AddMenuBefore
Inserts a new menu before another specified menu on this menu bar.
AddMenuLast
Appends a new menu to the end of this menu bar.
AddSubMenu [M]
Adds a submenu to this menu bar.
DisableAll [M]
Disables all menus in this menu bar, except for system menus (for example, the Apple menu and the Guide menu).
EnableAll [M]
Enables all menus in this menu bar, except for system menus (for example, the Apple menu and the Guide menu).
GetMenu
Returns a platform-specific menu structure for the specified menu ID.
RemoveMenu
Removes the menu with the specified ID from this menu bar.
Menu Items

GetItemString [M]
Gets the text string of the specified menu item.
SetItemString [M]
Sets the text string for the specified menu item.
EnableCommand [M]
Enables or disables the specified menu item.
CheckCommand [M]
Places a checkmark next to the specified menu item, or unchecks it.
EnableAndCheckCommand [M]
Enables or disables, and checks or unchecks, the specified menu item.
GetMenuAndItem [M]
Gets the menu/menu item designation for the specified command ID.
GetCommand [M]
Returns the command ID for the specified menu/menu item designation.
RegisterCommand [M]
Associates a command ID with the specified menu/menu item designation.
UnregisterCommand [M]
Removes the association between the specified command ID and its menu/menu item designation.
UnregisterAll [M]
Unregisters all command IDs currently registered with this menu bar object.
Menu Commands

IsCommandRegistered [M]
Returns a Boolean value that indicates whether the specified command ID is registered with this menu bar object.
IsCommandSynthetic [M]
Returns a Boolean value that indicates whether the specified command ID is synthetic.

Methods
AddMenuBefore
AddMenuLast
AddSubMenu
CheckCommand
Copy
DisableAll
Display
EnableAll
EnableAndCheckCommand
EnableCommand
GetCommand
GetItemString
GetMenu
GetMenuAndItem
IsCommandRegistered
IsCommandSynthetic
IsValid
RegisterCommand
RemoveMenu
SetItemString
UnregisterAll
UnregisterCommand

Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help